#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

typedef enum {
	MRRefreshNormal = 0,    //正常
    MRRefreshRelease,       //拖动到位，松开即可刷新或加载
	MRRefreshWorking,       //已松开，刷新或加载等待中
} MRRefreshStatus;

@interface MRRefreshView : UIView
{
    @public
    __weak IBOutlet UIImageView     *_imgArrow;
    __weak IBOutlet UILabel         *_labStatus;
    __weak IBOutlet UIActivityIndicatorView     *_indView;
}

@property (nonatomic, strong) NSString      *aryString;			//提示字符串，以","分离必需三段，例如: "下拉刷新,松开刷新,正在刷新"
@property (nonatomic) MRRefreshStatus	status;

@end

#pragma mark - 刷新控件

typedef enum {
    MRRefreshActionRefresh  = 0,
    MRRefreshActionManualLoad,
    MRRefreshActionAutoLoad,
} MRRefreshAction;

@interface MRRefreshControl : NSObject
{
	BOOL				_edgeValid;
	UIEdgeInsets		_edgeInset;
}

- (id)initWithScrollView:(UIScrollView *)scrollView;
@property (nonatomic, weak, readonly) UIScrollView		*scrollView;

@property (nonatomic) MRRefreshView			*viewRefresh;
@property (nonatomic) MRRefreshView			*viewLoad;

//手动刷新
- (void)manualRefresh;

//完成刷新
- (void)endRefreshing;
- (void)endLoading:(BOOL)end;

- (void)setTarget:(id)target action:(SEL)action type:(MRRefreshAction)type;

@end
